<!doctype html>
<html class="no-js">
<head>
<% include("/common/admin_head.html",{title: '系统设置', validatorJS: true, livequeryJS: true}){}%>
</head>
<body>
<!-- content start -->
<div class="admin-content">
  <div class="admin-content-body">
    <div class="am-cf app-padding-title">
      <div class="am-fl am-cf">
        <strong class="am-text-primary am-text-lg">网站设置</strong> / <small>系统设置</small>
      </div>
    </div>

    <hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-0" />
    
    <form class="validator-form" action="${base}/systemConfig/update" enctype="multipart/form-data" method="post">
    <div class="am-tabs am-margin" data-am-tabs="{noSwipe: 1}">
      <ul class="am-tabs-nav am-nav am-nav-tabs">
        <li class="am-active"><a href="#tab1">基本设置</a></li>
        <li><a href="#tab2">显示设置</a></li>
        <li><a href="#tab3">安全设置</a></li>
        <li><a href="#tab4">邮件设置</a></li>
        <li><a href="#tab5">其它设置</a></li>
        <li><a href="#tab6">横幅广告</a></li>
      </ul>
      
      <div class="am-tabs-bd am-form">
        <div class="am-tab-panel am-fade am-in am-active am-form-horizontal" id="tab1">
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">网店名称</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="text" class="am-form-field" name="systemConfig.shopName" value="${systemConfig.shopName!}" required />
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">网店网址</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="text" class="am-form-field" name="systemConfig.shopUrl" value="${systemConfig.shopUrl!}" required />
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">网店Logo</label>
            <div class="am-u-sm-4 am-u-md-6 am-form-file">
              <button type="button" class="am-btn am-btn-default am-btn-sm">
                <i class="am-icon-cloud-upload"></i> 上传图片
              </button>
              <input class="doc-form-file" type="file" name="shopLogo" />
            </div>
            <div class="am-u-sm-4 am-u-md-3">
              <div class="file-list">
                <%if (systemConfig.shopLogo != null){%><a href="${base}${systemConfig.shopLogo!}" class="am-btn am-btn-default am-btn-sm" target="_blank">查看</a><%}%>
              </div>
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">热门搜索关键词</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="text" class="am-form-field" name="systemConfig.hotSearch" value="${systemConfig.hotSearch!}" />
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">联系地址</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="text" class="am-form-field" name="systemConfig.address" value="${systemConfig.address!}" />
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">服务电话</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="text" class="am-form-field" name="systemConfig.phone" value="${systemConfig.phone!}" />
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">邮编</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="text" class="am-form-field js-pattern-zipCode" name="systemConfig.zipCode" value="${systemConfig.zipCode!}">
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">E-mail</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="email" class="am-form-field" name="systemConfig.email" value="${systemConfig.email!}">
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">备案号</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="text" class="am-form-field" name="systemConfig.certtext" value="${systemConfig.certtext!}" placeholder="填写您在工信部备案管理网站申请的备案编号">
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">首页页面关键词</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="text" class="am-form-field" name="systemConfig.metaKeywords" value="${systemConfig.metaKeywords!}">
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">首页页面描述</label>
            <div class="am-u-sm-8 am-u-md-9">
              <textarea rows="10" class="am-form-field" name="systemConfig.metaDescription">${systemConfig.metaDescription!}</textarea>
            </div>
          </div>
        </div>

        <div class="am-tab-panel am-fade am-form-horizontal" id="tab2">
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">商品图片（大）</label>
            <div class="am-u-sm-4 am-u-md-4">
              <div class="am-input-group am-input-group-sm">
                <span class="am-input-group-label am-padding-horizontal-0">宽度</span>
                <input type="number" class="am-form-field" name="systemConfig.bigProductImageWidth" value="${systemConfig.bigProductImageWidth!}" placeholder="单位:像素, 只允许输入零或正整数" min="0" required>
              </div>
            </div>
            <div class="am-u-sm-4 am-u-md-4 am-u-md-offset-1">
              <div class="am-input-group am-input-group-sm">
                <span class="am-input-group-label am-padding-horizontal-0">高度</span>
                <input type="number" class="am-form-field" name="systemConfig.bigProductImageHeight" value="${systemConfig.bigProductImageHeight!}" placeholder="单位:像素, 只允许输入零或正整数" min="0" required>
              </div>
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">商品图片（小）</label>
            <div class="am-u-sm-4 am-u-md-4">
              <div class="am-input-group am-input-group-sm">
                <span class="am-input-group-label am-padding-horizontal-0">宽度</span>
                <input type="number" class="am-form-field" name="systemConfig.smallProductImageWidth" value="${systemConfig.smallProductImageWidth!}" placeholder="单位:像素, 只允许输入零或正整数" min="0" required>
              </div>
            </div>
            <div class="am-u-sm-4 am-u-md-4 am-u-md-offset-1">
              <div class="am-input-group am-input-group-sm">
                <span class="am-input-group-label am-padding-horizontal-0">高度</span>
                <input type="number" class="am-form-field" name="systemConfig.smallProductImageHeight" value="${systemConfig.smallProductImageHeight!}" placeholder="单位:像素, 只允许输入零或正整数" min="0" required>
              </div>
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">商品缩略图</label>
            <div class="am-u-sm-4 am-u-md-4">
              <div class="am-input-group am-input-group-sm">
                <span class="am-input-group-label am-padding-horizontal-0">宽度</span>
                <input type="number" class="am-form-field" name="systemConfig.thumbnailProductImageWidth" value="${systemConfig.thumbnailProductImageWidth!}" placeholder="单位:像素, 只允许输入零或正整数" min="0" required>
              </div>
            </div>
            <div class="am-u-sm-4 am-u-md-4 am-u-md-offset-1">
              <div class="am-input-group am-input-group-sm">
                <span class="am-input-group-label am-padding-horizontal-0">高度</span>
                <input type="number" class="am-form-field" name="systemConfig.thumbnailProductImageHeight" value="${systemConfig.thumbnailProductImageHeight!}" placeholder="单位:像素, 只允许输入零或正整数" min="0" required>
              </div>
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">默认商品图片（大）</label>
            <div class="am-u-sm-4 am-u-md-6 am-form-file">
              <button type="button" class="am-btn am-btn-default am-btn-sm">
                <i class="am-icon-cloud-upload"></i> 上传图片
              </button>
              <input class="doc-form-file" type="file" name="defaultBigProductImage">
            </div>
            <div class="am-u-sm-4 am-u-md-3">
              <div class="file-list">
                <%if (systemConfig.defaultBigProductImagePath != null){%><a href="${base}${systemConfig.defaultBigProductImagePath!}" class="am-btn am-btn-default am-btn-sm" target="_blank">查看</a><%}%>
              </div>
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">默认商品图片（小）</label>
            <div class="am-u-sm-4 am-u-md-6 am-form-file">
              <button type="button" class="am-btn am-btn-default am-btn-sm">
                <i class="am-icon-cloud-upload"></i> 上传图片
              </button>
              <input class="doc-form-file" type="file" name="defaultSmallProductImage">
            </div>
            <div class="am-u-sm-4 am-u-md-3">
              <div class="file-list">
                <%if (systemConfig.defaultSmallProductImagePath != null){%><a href="${base}${systemConfig.defaultSmallProductImagePath!}" class="am-btn am-btn-default am-btn-sm" target="_blank">查看</a><%}%>
              </div>
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">默认缩略图</label>
            <div class="am-u-sm-4 am-u-md-6 am-form-file">
              <button type="button" class="am-btn am-btn-default am-btn-sm">
                <i class="am-icon-cloud-upload"></i> 上传图片
              </button>
              <input class="doc-form-file" type="file" name="defaultThumbnailProductImage">
            </div>
            <div class="am-u-sm-4 am-u-md-3">
              <div class="file-list">
                <%if (systemConfig.defaultThumbnailProductImagePath != null){%><a href="${base}${systemConfig.defaultThumbnailProductImagePath!}" class="am-btn am-btn-default am-btn-sm" target="_blank">查看</a><%}%>
              </div>
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">水印图片</label>
            <div class="am-u-sm-4 am-u-md-6 am-form-file">
              <button type="button" class="am-btn am-btn-default am-btn-sm">
                <i class="am-icon-cloud-upload"></i> 上传图片
              </button>
              <input class="doc-form-file" type="file" name="watermarkImage">
            </div>
            <div class="am-u-sm-4 am-u-md-3">
              <div class="file-list">
                <%if (systemConfig.watermarkImagePath != null){%><a href="${base}${systemConfig.watermarkImagePath!}" class="am-btn am-btn-default am-btn-sm" target="_blank">查看</a><%}%>
              </div>
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">水印位置</label>
            <div class="am-u-sm-8 am-u-md-9">
              <%for(list in allWatermarkPosition){%>
              <label class="am-radio-inline">
                <input type="radio" name="systemConfig.watermarkPosition" value="${list}" <%if (systemConfig.watermarkPosition == list){%> checked="true"<%}%> />${i18n("WatermarkPosition." + list)}
              </label>
              <%}%>
            </div>
          </div> 
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">水印透明度</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="number" class="am-form-field" name="systemConfig.watermarkAlpha" value="${systemConfig.watermarkAlpha!}" placeholder="取值范围:0-100,  0代表完全透明" min="0" max="100">
            </div>
          </div>
        </div>
        
        <div class="am-tab-panel am-fade am-form-horizontal" id="tab3"> 
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">是否开放注册</label>
            <div class="am-u-sm-8 am-u-md-9">
              <label class="am-radio-inline">
                <input type="radio" name="systemConfig.isRegister" value="true"<%if (systemConfig.isRegister == true){%> checked<%}%> />是
              </label>
              <label class="am-radio-inline">
                <input type="radio" name="systemConfig.isRegister" value="false"<%if (systemConfig.isRegister == false){%> checked<%}%> />否
              </label>
            </div>
          </div>      
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">是否自动锁定账号</label>
            <div class="am-u-sm-8 am-u-md-9">
              <label class="am-radio-inline">
                <input type="radio" name="systemConfig.isLoginFailureLock" value="true"<%if (systemConfig.isLoginFailureLock == true){%> checked<%}%> />是
              </label>
              <label class="am-radio-inline">
                <input type="radio" name="systemConfig.isLoginFailureLock" value="false"<%if (systemConfig.isLoginFailureLock == false){%> checked<%}%> />否
              </label>
            </div>
          </div>         
          <div id="loginFailureLockCountTr" class="am-form-group am-form-group-sm<%if (systemConfig.isLoginFailureLock == false){%> hidden<%}%>">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">连续登录失败最大次数</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="number" class="am-form-field" name="systemConfig.loginFailureLockCount" value="${systemConfig.loginFailureLockCount!}" placeholder="只允许输入正整数,当连续登录失败次数超过设定值时,系统将自动锁定该账号" min="1">
            </div>
          </div>
          <div id="loginFailureLockTimeTr" class="am-form-group am-form-group-sm<%if (systemConfig.isLoginFailureLock == false){%> hidden<%}%>">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">自动解锁时间</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="number" class="am-form-field" name="systemConfig.loginFailureLockTime" value="${systemConfig.loginFailureLockTime!}" placeholder="只允许输入零或正整数,账号锁定后,自动解除锁定的时间,单位:分钟,0表示永久锁定" min="0">
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">允许上传图片文件扩展名</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="text" class="am-form-field" name="systemConfig.allowedUploadImageExtension" value="${systemConfig.allowedUploadImageExtension!}" placeholder="为空表示不允许上传图片文件,多个扩展名请以(${@com.jfinalshop.bean.SystemConfig.EXTENSION_SEPARATOR})分隔">
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">允许上传媒体文件扩展名</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="text" class="am-form-field" name="systemConfig.allowedUploadMediaExtension" value="${systemConfig.allowedUploadMediaExtension!}" placeholder="为空表示不允许上传媒体文件,多个扩展名请以(${@com.jfinalshop.bean.SystemConfig.EXTENSION_SEPARATOR})分隔">
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">允许上传其它文件扩展名</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="text" class="am-form-field" name="systemConfig.allowedUploadFileExtension" value="${systemConfig.allowedUploadFileExtension!}" placeholder="为空表示不允许上传其它文件,多个扩展名请以(${@com.jfinalshop.bean.SystemConfig.EXTENSION_SEPARATOR})分隔">
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">文件上传最大值</label>
            <div class="am-u-sm-8 am-u-md-9">
              <select name="systemConfig.uploadLimit" data-am-selected="{btnWidth: '100%', maxHeight: '200px', btnSize: 'sm', dropUp: 1}" required>
                <option value="512" <%if (systemConfig.uploadLimit == 512){%>selected="selected" <%}%>>
                  512K
                </option>
                <option value="1024" <%if (systemConfig.uploadLimit == 1024){%>selected="selected" <%}%>>
                  1M
                </option>
                <option value="2048" <%if (systemConfig.uploadLimit == 2048){%>selected="selected" <%}%>>
                  2M
                </option>
                <option value="3072" <%if (systemConfig.uploadLimit == 3072){%>selected="selected" <%}%>>
                  3M
                </option>
                <option value="5120" <%if (systemConfig.uploadLimit == 5120){%>selected="selected" <%}%>>
                  5M
                </option>
                <option value="5120" <%if (systemConfig.uploadLimit == 10240){%>selected="selected" <%}%>>
                  10M
                </option>
                <option value="5120" <%if (systemConfig.uploadLimit == 15360){%>selected="selected" <%}%>>
                  15M
                </option>
                <option value="0" <%if (systemConfig.uploadLimit == 0){%>selected="selected" <%}%>>
                  无限制
                </option>
              </select>
            </div>
          </div>
        </div>
        
        <div class="am-tab-panel am-fade am-form-horizontal" id="tab4">
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">发件人邮箱</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="text" class="am-form-field" name="systemConfig.smtpFromMail" value="${systemConfig.smtpFromMail!}">
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">SMTP服务器地址</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="text" class="am-form-field" name="systemConfig.smtpHost" value="${systemConfig.smtpHost!}">
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">SMTP服务器端口</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="number" class="am-form-field" name="systemConfig.smtpPort" value="${systemConfig.smtpPort!}" placeholder="默认端口为25">
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">SMTP用户名</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="text" class="am-form-field" name="systemConfig.smtpUsername" value="${systemConfig.smtpUsername!}">
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">SMTP密码</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="password" class="am-form-field" name="systemConfig.smtpPassword" value="${systemConfig.smtpPassword!}" placeholder="留空则不进行密码修改">
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">邮箱配置测试</label>
            <div class="am-u-sm-8 am-u-md-9">
              <button type="button" id="showSmtpTestWindow" class="am-btn am-btn-primary am-btn-xs">邮箱配置测试</button>
            </div>
          </div>
        </div>
        
        <div class="am-tab-panel am-fade am-form-horizontal" id="tab5">
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">货币种类</label>
            <div class="am-u-sm-8 am-u-md-9">
              <select id="currencyType" name="systemConfig.currencyType" data-am-selected="{btnWidth: '100%', maxHeight: '200px', btnSize: 'sm'}" required>
                <option value=""></option>
                <%for(list in allCurrencyType){%>
                <option value="${list}"<%if (list == systemConfig.currencyType){%> selected <%}%>>
                  ${i18n("CurrencyType." + list)}
                </option>
                <%}%>
              </select>
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">货币符号</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="text" class="am-form-field" name="systemConfig.currencySign" value="${systemConfig.currencySign!}">
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">货币单位</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="text" class="am-form-field" name="systemConfig.currencyUnit" value="${systemConfig.currencyUnit!}">
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">商品价格精确位数</label>
            <div class="am-u-sm-8 am-u-md-9">
              <select name="systemConfig.priceScale" data-am-selected="{btnWidth: '100%', maxHeight: '200px', btnSize: 'sm'}" required>
                <option value="0" <%if (systemConfig.priceScale == 0){%>selected="selected" <%}%>>
				  无小数位
				</option>
				<option value="1" <%if (systemConfig.priceScale == 1){%>selected="selected" <%}%>>
				  1位小数
				</option>
				<option value="2" <%if (systemConfig.priceScale == 2){%>selected="selected" <%}%>>
				  2位小数
				</option>
				<option value="3" <%if (systemConfig.priceScale == 3){%>selected="selected" <%}%>>
				  3位小数
				</option>
				<option value="4" <%if (systemConfig.priceScale == 4){%>selected="selected" <%}%>>
				  4位小数
				</option>
              </select>
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">商品价格精确方式</label>
            <div class="am-u-sm-8 am-u-md-9">
              <select name="systemConfig.priceRoundType" data-am-selected="{btnWidth: '100%', maxHeight: '200px', btnSize: 'sm'}" required>
                <%for(list in allRoundType){%>
				<option value="${list}" <%if (systemConfig.priceRoundType == list){%>selected="selected" <%}%>>
				  ${i18n("RoundType." + list)}
				</option>
				<%}%>
              </select>
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">订单金额精确位数</label>
            <div class="am-u-sm-8 am-u-md-9">
              <select name="systemConfig.orderScale" data-am-selected="{btnWidth: '100%', maxHeight: '200px', btnSize: 'sm'}" required>
                <option value="0" <%if (systemConfig.orderScale == 0){%>selected="selected" <%}%>>
				  无小数位
				</option>
		        <option value="1" <%if (systemConfig.orderScale == 1){%>selected="selected" <%}%>>
				  1位小数
				</option>
				<option value="2" <%if (systemConfig.orderScale == 2){%>selected="selected" <%}%>>
				  2位小数
				</option>
				<option value="3" <%if (systemConfig.orderScale == 3){%>selected="selected" <%}%>>
				  3位小数
				</option>
				<option value="4" <%if (systemConfig.orderScale == 4){%>selected="selected" <%}%>>
				  4位小数
			    </option>
              </select>
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">订单金额精确方式</label>
            <div class="am-u-sm-8 am-u-md-9">
              <select name="systemConfig.orderRoundType" data-am-selected="{btnWidth: '100%', maxHeight: '200px', btnSize: 'sm'}" required>
                <%for(list in allRoundType){%>
				<option value="${list}" <%if (systemConfig.orderRoundType == list){%>selected="selected" <%}%>>
				  ${i18n("RoundType." + list)}
				</option>
				<%}%>
              </select>
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">商品库存报警数量</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="number" class="am-form-field" name="systemConfig.storeAlertCount" value="${systemConfig.storeAlertCount!}" placeholder="只允许输入零或正整数 " min="0">
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">库存预占时间点</label>
            <div class="am-u-sm-8 am-u-md-9">
              <select name="systemConfig.storeFreezeTime" data-am-selected="{btnWidth: '100%', maxHeight: '200px', btnSize: 'sm', dropUp: 1}" required>
                <%for(list in allStoreFreezeTime){%>
                <option value="${list}" <%if (systemConfig.storeFreezeTime == list){%>selected="selected" <%}%>>
                  ${i18n("StoreFreezeTime." + list)}
                </option>
                <%}%>
              </select>
            </div>
          </div>
          <div class="am-form-group am-form-group-sm">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">积分获取方式</label>
            <div class="am-u-sm-8 am-u-md-9">
              <%for(list in allPointType){%>
              <label class="am-radio-inline">
                <input type="radio" name="systemConfig.pointType" value="${list}" <%if (systemConfig.pointType == list){%> checked="true"<%}%> />${i18n("PointType." + list)}
              </label>
              <%}%>
            </div>
          </div> 
          <div class="am-form-group am-form-group-sm pointScaleTr<%if (systemConfig.pointType != "orderAmount"){%> hidden<%}%>">
            <label class="am-u-sm-4 am-u-md-3 am-text-right am-form-label">积分换算比率</label>
            <div class="am-u-sm-8 am-u-md-9">
              <input type="number" class="am-form-field" name="systemConfig.pointScale" value="${systemConfig.pointScale!}" placeholder="每消费1元可获得积分数 " min="0">
            </div>
          </div>
        </div>
         
        <div class="am-tab-panel am-fade app-min-height app-banner-image" id="tab6">
          <ul class="am-avg-sm-1 am-avg-md-2 am-thumbnails" id="banner-file-list">
            <%for(list in systemConfig.bannerImagePathList!){%>
            <li>
              <div class="am-thumbnail">
                <input type="hidden" name="bannerImagePathItems" value="${list}" />
                <div class="app-product-image-preview am-text-center am-text-warning">
                  <img src="${base}${list}" class="am-img-bdrs">
                </div>
                <ul class="am-thumbnail-caption am-avg-sm-3">
                  <li><button type="button" class="am-btn am-btn-default am-text-warning am-btn-xs am-center opr-img-left"><span class="am-icon-chevron-left"></span></button></li>
                  <li><button type="button" class="am-btn am-btn-default am-text-danger am-btn-xs am-center opr-img-delete"><span class="am-icon-trash"></span></button></li>
                  <li><button type="button" class="am-btn am-btn-default am-text-warning am-btn-xs am-center opr-img-right"><span class="am-icon-chevron-right"></span></button></li>
                </ul>
                <hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-0" />
                <ul class="am-thumbnail-caption am-avg-sm-1">
                  <li>
                    <div class="am-form-group am-form-file">
                      <button type="button" class="am-btn am-btn-success am-btn-xs am-center" disabled="disabled">
                        <i class="am-icon-info-circle"></i> 已经上传
                      </button>
                    </div>
                  </li>
                </ul>
              </div>
            </li>
            <%}%>
            <li>
              <div class="am-thumbnail">
                <div class="app-banner-image-preview am-text-center am-text-warning">
                  暂无图片
                </div>
                <ul class="am-thumbnail-caption am-avg-sm-3">
                  <li><button type="button" class="am-btn am-btn-default am-text-warning am-btn-xs am-center opr-img-left"><span class="am-icon-chevron-left"></span></button></li>
                  <li><button type="button" class="am-btn am-btn-default am-text-danger am-btn-xs am-center opr-img-delete" disabled="disabled"><span class="am-icon-trash"></span></button></li>
                  <li><button type="button" class="am-btn am-btn-default am-text-warning am-btn-xs am-center opr-img-right"><span class="am-icon-chevron-right"></span></button></li>
                </ul>
                <hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-0" />
                <ul class="am-thumbnail-caption am-avg-sm-1">
                  <li>
                    <div class="am-form-group am-form-file">
                      <%if (systemConfig.allowedUploadImageExtension != ""){%>
                      <button type="button" class="am-btn am-btn-default am-btn-xs am-center">
                        <i class="am-icon-cloud-upload"></i> 上传图片
                      </button>
                      <input class="banner-form-file" name="bannerImageFile0" type="file">
                      <%}else{%>
                      <button type="button" class="am-btn am-btn-danger am-btn-xs am-center" disabled="disabled">
                        <i class="am-icon-warning"></i> 不允许上传
                      </button>
                      <%}%>
                    </div>
                  </li>
                </ul>
              </div>
            </li>
          </ul>
            
          <div class="am-alert am-alert-warning am-text-xs">
            <span class="am-icon-warning"> <strong>请将上传图片的大小设置为778x260</strong>!</span>
            <%if (systemConfig.allowedUploadImageExtension != ""){%>
            <%if ((systemConfig.uploadLimit != 0) && (systemConfig.uploadLimit < 1024)){%>
            小于${systemConfig.uploadLimit}KB
            <%}else if (systemConfig.uploadLimit >= 1024){%>
            小于${systemConfig.uploadLimit / 1024}MB
            <%}%> 
            <%for(list in strutil.split(systemConfig.allowedUploadImageExtension,@com.jfinalshop.bean.SystemConfig.EXTENSION_SEPARATOR)){%>
            <%if (listLP.last){%>
            *.${list};
            <%}else{%>
            *.${list}
            <%}%>
            <%}%>
            <%}else{%>
            系统设置不允许上传图片文件!
            <%}%>
          </div>
        </div>
       </div>
    </div>
    <div class="am-margin">
      <button type="submit" class="am-btn am-btn-primary"><span class="am-icon-save">  保  存</span></button>
    </div>
    </form>
  </div>
</div>
<div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-1">
  <div class="am-modal-dialog">
    <div class="am-modal-hd">&nbsp;
      <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
    </div>
    <div class="am-modal-bd am-form am-form-horizontal">
      <form action="${base}/mail/ajaxSendSmtpTest">
        <div id="smtpTestForm">
        <input type="hidden" name="smtpFromMail" value="" required />
        <input type="hidden" name="smtpHost" value="" required />
        <input type="hidden" name="smtpPort" value="" required />
        <input type="hidden" name="smtpUsername" value="" required />
        <input type="hidden" name="smtpPassword" value="" required />
        </div>
        <div class="am-form-group am-form-group-sm">
          <label for="doc-ipt-1" class="am-u-sm-4 am-form-label">收件人邮箱</label>
          <div class="am-u-sm-8">
            <input type="email" id="doc-ipt-1" name="smtpToMail" placeholder="输入收件人邮箱" required>
          </div>
        </div>
        <div class="am-form-group am-form-group-sm">
          <div class="am-u-sm-8 am-u-sm-offset-4">
            <button type="submit" class="am-btn am-btn-default">测试发送</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>
<!-- content end -->
<script>
$().ready(function() {
  $('.doc-form-file').on('change', function() {
    var fileNames = '';
    $.each(this.files, function() {
      fileNames += '<span class="am-badge">' + this.name + '</span> ';
    });
    $(this).parent().next().find('.file-list').html(fileNames);
  });

  var $isLoginFailureLockInput = $("input[name='systemConfig.isLoginFailureLock']");
  var $loginFailureLockCountTr = $("#loginFailureLockCountTr");
  var $loginFailureLockTimeTr = $("#loginFailureLockTimeTr");

  var $smtpFromMail = $("input[name='systemConfig.smtpFromMail']");
  var $smtpHost = $("input[name='systemConfig.smtpHost']");
  var $smtpPort = $("input[name='systemConfig.smtpPort']");
  var $smtpUsername = $("input[name='systemConfig.smtpUsername']");
  var $smtpPassword = $("input[name='systemConfig.smtpPassword']");
  var $showSmtpTestWindow = $("#showSmtpTestWindow");
  var $pointType = $("input[name='systemConfig.pointType']");
  var $pointScaleTr = $(".pointScaleTr");
  var $pointScale = $("input[name='systemConfig.pointScale']");
  
  $isLoginFailureLockInput.click( function() {
    $this = $(this);
    if($this.val() == "true") {
      $loginFailureLockCountTr.show();
      $loginFailureLockTimeTr.show();
    } else {
      $loginFailureLockCountTr.hide();
      $loginFailureLockTimeTr.hide();
    }
  });
  
  // SMTP测试窗口
  $showSmtpTestWindow.click( function() {
    if(!$smtpFromMail.val() || !$smtpHost.val() || !$smtpPort.val() || !$smtpUsername.val() || !$smtpPassword.val()){
        Modal.alert('请先将邮箱设置相关信息补充完整');
        return false;
    }
    var formHtml = '<input type="hidden" name="smtpFromMail" required value="' + $smtpFromMail.val() + '" required />' 
        + '<input type="hidden" name="smtpHost" value="' + $smtpHost.val() + '" required />'
        + '<input type="hidden" name="smtpPort" value="' + $smtpPort.val() + '" required />'
        + '<input type="hidden" name="smtpUsername" value="' + $smtpUsername.val() + '" required />'
        + '<input type="hidden" name="smtpPassword" value="' + $smtpPassword.val() + '" required />';
    $('#smtpTestForm').html(formHtml);
    $('#doc-modal-1').modal({
        closeViaDimmer: 0,
        width: 400,
        height: 225
      });
  });
  
  // 根据积分获取方式显示/隐藏“积分换算比率”
  $pointType.click( function() {
    $this = $(this);
    if($this.val() == "orderAmount") {
      $pointScaleTr.show();
    } else {
      $pointScale.val("0");
      $pointScaleTr.hide();
    }
  });
  
  //图片左移
  $(".opr-img-left").livequery("click", function() {
    var $bannerImageLi = $(this).parent().parent().parent().parent();
    var $bannerImagePrevLi = $bannerImageLi.prev("li");
    if ($bannerImagePrevLi.length > 0) {
      $bannerImagePrevLi.insertAfter($bannerImageLi);
    }
  });
    
  // 图片右移
  $(".opr-img-right").livequery("click", function() {
    var $bannerImageLi = $(this).parent().parent().parent().parent();
    var $bannerImageNextLi = $bannerImageLi.next("li");
    if ($bannerImageNextLi.length > 0) {
      $bannerImageNextLi.insertBefore($bannerImageLi);
    }
  });
    
  // 图片删除
  $(".opr-img-delete").livequery("click", function() {
    var $bannerImageLi = $(this).parent().parent().parent().parent();
    $bannerImageLi.remove();
  });
    
  // 添加图片
  var bannerImageLiHtmlTemp = '<li><div class="am-thumbnail">'
        + '<div class="app-banner-image-preview am-text-center am-text-warning">暂无图片</div>'
        + '<ul class="am-thumbnail-caption am-avg-sm-3">'
        + '<li><button type="button" class="am-btn am-btn-default am-text-warning am-btn-xs am-center opr-img-left"><span class="am-icon-chevron-left"></span></button></li>'
        + '<li><button type="button" class="am-btn am-btn-default am-text-danger am-btn-xs am-center opr-img-delete" disabled="disabled"><span class="am-icon-trash"></span></button></li>'
        + '<li><button type="button" class="am-btn am-btn-default am-text-warning am-btn-xs am-center opr-img-right"><span class="am-icon-chevron-right"></span></button></li>'
        + '</ul><hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-0" /><ul class="am-thumbnail-caption am-avg-sm-1">'
        + '<li><div class="am-form-group am-form-file"><button type="button" class="am-btn am-btn-default am-btn-xs am-center"><i class="am-icon-cloud-upload"></i> 上传图片</button><input class="banner-form-file" name="bannerImageFile" type="file"></div></li>';
        + '</ul></div></li>';
        
  var index = 0;        
  $("input.banner-form-file").livequery('change', function() {
    var $this = $(this);
    var $bannerImageLi = $this.parent().parent().parent().parent();
    var $bannerImagePreview = $bannerImageLi.find(".app-banner-image-preview");
    var $bannerImageDeteleBtn = $bannerImageLi.find(".opr-img-delete");
    var fileName = $this.val().substr($this.val().lastIndexOf("\\") + 1);
    if (/(<%for(list in strutil.split(systemConfig.allowedUploadImageExtension,@com.jfinalshop.bean.SystemConfig.EXTENSION_SEPARATOR)){%><%if (!listLP.last){%>.${list}|<%}else{%>.${list}<%}%><%}%>)$/i.test($this.val()) == false) {
      $.message("您选择的文件格式错误！");
      return false;
    }
    $bannerImagePreview.html('<input type="hidden" name="bannerImagePathItems" value="file" /><img src="' + window.URL.createObjectURL($this[0].files[0]) + '" class="am-img-bdrs">');
    if($bannerImageDeteleBtn.attr('disabled')){
      index++;
      $bannerImageDeteleBtn.attr('disabled',false);
      var bannerImageLiHtml = bannerImageLiHtmlTemp;
      bannerImageLiHtml = bannerImageLiHtml.replace("bannerImageFile", "bannerImageFile"+index);
      $('#banner-file-list').append(bannerImageLiHtml);
    }
  });
  
});
</script>
</body>
</html>